import java.util.ArrayList;

/**
 * @Author Fish Paradise
 * @Description
 * @Date 2019/1/14  19:31
 **/
public class BookShelf implements Aggregate {
    private ArrayList<Book> books = new ArrayList<Book>(0);

    public BookIterator iterator() {
        return new BookShelfIterator(this);
    }

    public int getLength(){
        return books.size();
    }

    public Book getBookAt(int index){
        return books.get(index);
    }

    public void appendBook(Book book){
        books.add(book);
    }

}
